package com.example;

import org.junit.Test;

public class AnimalTest {

    @Test
    public void test01() {
        Cat cat = new Cat(); // Animal的，还是Cat隐藏的
        cat.setName("小肥");
        System.out.println(cat.getName());
        cat.setAge(2);
        System.out.println(cat.getAge());
    }

    @Test
    public void test02() {
        Cat cat = new Cat("小肥", 2);
        System.out.println(cat.getName()); // 小肥
        System.out.println(cat.getAge()); // 2
        cat.setColor("蓝色");
        Cat cat1 = new Cat("小黑", 2, "黑色");
        String string = cat.toString(); // 内存地址
        System.out.println(string);
        System.out.println(cat1);
        cat.catching();
    }
}
